package com.gx.spring.event.springevent.event;

import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * Created by GX on 2017/9/12.
 */
@Service
public class NameService {


    @Async
    @EventListener
    public void listenUserRegisterEvent(UserRegisterEvent userRegisterEvent) {
//        while (true){
//
//        }
        System.out.println("积分服务接到通知，给 " + userRegisterEvent.getSource() + " 积分");
    }

}
